home *** CD-ROM | disk | FTP | other *** search
- /* This example use of exif.library reads and displays any exif
- information contained in a jfif file.
- */
-
- #include <stdio.h>
-
- #include <exec/types.h>
-
- #include <clib/exec_protos.h>
-
- #include <pragmas/exec_pragmas.h>
-
- #include <exif/exif.h>
- #include <exif/exif_protos.h>
- #include <exif/exif_pragmas.h>
-
- struct Library *ExifBase;
-
- char *version = "$VER: read 1.0 (3.1.2001)";
-
- void main( int argc, char **argv )
- {
- if ( argv[1] )
- {
- ExifBase = OpenLibrary( "exif.library", 1 );
-
- if ( ExifBase != NULL )
- {
- struct Exif *exif;
-
- exif = ReadExif( argv[1], NULL );
- if ( exif )
- {
- struct MinNode *work1, *next1, *work2, *next2;
-
- printf( "Exif length=%ld\n", exif->ExifLength );
- printf( "Thumbnail size=%ld\n", exif->ThumbnailSize );
-
- work1 = exif->ExifTagList.mlh_Head;
-
- while ( next1 = work1->mln_Succ )
- {
- printf( "DIR NAME: %s\n",( (struct ExifTagDir *)work1 )->etd_ID );
-
- work2 = ( (struct ExifTagDir *)work1 )->etd_Dir.mlh_Head;
-
- while ( next2 = work2->mln_Succ )
- {
- char *data = (char *)( (struct ExifTag *)work2 )->et_StringEquiv;
-
- if ( data[0] != NULL )
- {
- printf("\t%s=%s\n", (char *)( (struct ExifTag *)work2 )->et_TagDescription, data );
- }
-
- work2 = next2;
- }
-
- work1 = next1;
- }
-
- FreeExif( exif );
- }
- }
-
- if ( ExifBase != NULL ) CloseLibrary( ExifBase );
- else printf( "you need exif.library v1.0 minimum\n" );
- }
- else
- {
- printf( "no source file specified\n" );
- }
- }
-